var e = require("../../../@babel/runtime/helpers/defineProperty"), a = getApp();

Component({
    properties: {
        datas: {
            type: null
        },
        component_id: {
            type: null
        },
        notShow: {
            type: null
        }
    },
    data: {
        emptyImage: "https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/image.png",
        activeNames: !0,
        TemplateArray_1: [],
        TemplateArray_2: []
    },
    lifetimes: {
        attached: function() {},
        moved: function() {},
        detached: function() {}
    },
    attached: function() {},
    ready: function() {},
    methods: {
        errorFunction: function(a) {
            var t = "datas.show_list[" + a.currentTarget.dataset.index + "].image";
            this.setData(e({}, t, "https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/image.png"));
        },
        getTemplate_1: function(e) {
            var t = a.getNetAddresss("member.member.getMiniTemplateCorrespond"), o = this;
            a._getNetWork({
                url: t,
                data: {
                    small_type: 4
                },
                success: function(a) {
                    var t = a.data;
                    if (1 == t.result) {
                        for (var n = [], i = 0; i < t.data.length; i++) n.push(t.data[i].template_id);
                        o.setData({
                            TemplateArray_1: n
                        }), wx.requestSubscribeMessage({
                            tmplIds: o.data.TemplateArray_1,
                            success: function(a) {
                                "supplier" == e ? wx.navigateTo({
                                    url: "/packageA/member/supplier/supplier"
                                }) : wx.navigateTo({
                                    url: "/packageA/member/SupplierCenter/SupplierCenter?uid=" + o.data.supplier_id
                                });
                            },
                            fail: function() {
                                "supplier" == e ? wx.navigateTo({
                                    url: "/packageA/member/supplier/supplier"
                                }) : wx.navigateTo({
                                    url: "/packageA/member/SupplierCenter/SupplierCenter?uid=" + o.data.supplier_id
                                });
                            }
                        });
                    } else wx.showToast({
                        title: t.msg,
                        icon: "none",
                        duration: 1500
                    });
                },
                fail: function(e) {
                    console.log(e);
                }
            });
        },
        getTemplate_2: function() {
            var e = a.getNetAddresss("member.member.getMiniTemplateCorrespond"), t = this;
            a._getNetWork({
                url: e,
                data: {
                    small_type: 5
                },
                success: function(e) {
                    var a = e.data;
                    if (1 == a.result) {
                        for (var o = [], n = 0; n < a.data.length; n++) o.push(a.data[n].template_id);
                        t.setData({
                            TemplateArray_2: o
                        }), wx.requestSubscribeMessage({
                            tmplIds: t.data.TemplateArray_2,
                            success: function(e) {
                                wx.navigateTo({
                                    url: "/packageC/o2o/storeManage/storeManage"
                                });
                            },
                            fail: function() {
                                wx.navigateTo({
                                    url: "/packageC/o2o/storeManage/storeManage"
                                });
                            }
                        });
                    } else wx.showToast({
                        title: a.msg,
                        icon: "none",
                        duration: 1500
                    });
                },
                fail: function(e) {
                    console.log(e);
                }
            });
        },
        pluginGoto: function(e) {
            var a = e.currentTarget.dataset.item, t = a.url;
            if ("storeManage" != a.url) if ("extension" != a.url) if ("courier" == a.name) wx.setStorage({
                key: "couriername",
                data: a.title
            }), wx.navigateTo({
                url: "/packageA/member/" + t + "/" + t
            }); else if ("supplier" == a.name || "SupplierCenter" == a.name) {
                this.getTemplate_1(a.url);
            } else "HotelManage" == a.url ? wx.navigateTo({
                url: "/packageA/hotel/HotelManage/HotelManage?title=" + encodeURIComponent("酒店管理")
            }) : "aftersaleslist" == a.url ? this.goaftersaleslist() : "helperLiveList" == a.url ? this.getTemplate() : "subsidiary" == a.url ? wx.navigateTo({
                url: "/packageA/member/myOrder_v2/myOrder_v2?status=0&orderType=subsidiary"
            }) : "cloudIndex" == a.url ? wx.navigateTo({
                url: "/packageE/others/cloudwarehouse/cloud_index/cloud_index"
            }) : wx.navigateTo({
                url: a.mini_url
            }); else this.goextension(); else this.gostoreManage();
        },
        goaftersaleslist: function() {
            wx.navigateTo({
                url: "/packageD/member/myOrder/Aftersaleslist/Aftersaleslist"
            });
        },
        gocollection: function(e) {
            wx.navigateTo({
                url: "/packageD/member/collection/collection"
            });
        },
        gofootprint: function(e) {
            wx.navigateTo({
                url: "/packageD/member/footprint/footprint"
            });
        },
        gomyEvaluation: function(e) {
            wx.navigateTo({
                url: "/packageD/member/myEvaluation/myEvaluation"
            });
        },
        gomyRelationship: function(e) {
            wx.navigateTo({
                url: "/packageD/member/myRelationship/myRelationship"
            });
        },
        goaddress: function(e) {
            wx.navigateTo({
                url: "/packageD/member/addressList/addressList"
            });
        },
        gocoupon: function(e) {
            wx.navigateTo({
                url: "/packageA/member/coupon_v2/coupon_v2"
            });
        },
        goinfo: function(e) {
            wx.navigateTo({
                url: "/packageA/member/info/info"
            });
        },
        gosign: function() {
            wx.navigateTo({
                url: "/packageA/member/sign/sign"
            });
        },
        gocashier: function() {
            wx.navigateTo({
                url: "/packageC/cashier/cashier/cashier"
            });
        },
        gomicroShop_home: function() {
            wx.navigateTo({
                url: "/packageC/microshop/microShop_home/microShop_home"
            });
        },
        gomicroShop_apply: function() {
            wx.navigateTo({
                url: "/packageC/microshop/microShop_apply/microShop_apply"
            });
        },
        gooverseas_index: function() {
            wx.navigateTo({
                url: "/packageB/member/overseas_index/overseas_index"
            });
        },
        gostoreManage: function() {
            this.getTemplate_2();
        },
        gohelpcenter: function() {
            wx.navigateTo({
                url: "/packageB/member/helpcenter/helpcenter"
            });
        },
        goFrozenCoin: function() {
            wx.navigateTo({
                url: "/packageB/member/FrozenCoin/FrozenCoin"
            });
        },
        golove_index: function() {
            wx.navigateTo({
                url: "/packageB/member/love/Love_index/Love_index"
            });
        },
        goextension: function() {
            wx.reLaunch({
                url: "/packageG/pages/member/extension/extension"
            });
        },
        onChange: function(e) {
            this.setData({
                activeNames: !this.data.activeNames
            });
        },
        gotoUrl: function(e) {
            var a = e.currentTarget.dataset.item.h5_link;
            try {
                wx.navigateTo({
                    url: a
                });
            } catch (e) {
                wx.showToast({
                    title: "链接设置错误",
                    icon: "none",
                    duration: 2e3
                });
            }
        }
    }
});